package com.lhz.project.system.mapper.auth;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lhz.common.page.BaseQueryParam;
import com.lhz.project.system.model.entity.auth.Menu;
import com.lhz.project.system.model.vo.auth.MenuTreeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author LiHuaZhi
 * @since 2020-06-15 22:42:29
 */
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {

    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    Menu selectByPrimaryKey(Integer id);

    List<Menu> listMenu(@Param("param") BaseQueryParam param, @Param("userId") String userId);

    //根据父级id查询
    List<Menu> selectByParentId(Integer id);

    //检查名称
    int checkName(@Param("name") String name, @Param("id") Integer id);

    //树形结构
    List<MenuTreeVo> selectTreeMenu(String userId);

    List<Menu> treeMenuListByUserId(String userId);
}